<template>
  <div>
    <h1>{{ name }}</h1>
    <h2>{{ address }}</h2>
    <br/>
    <button @click="sendShcoolName">touchMe</button>
    <button @click="backAddress">backAddress</button>
  </div>
</template>
  
<script>
import Vue from "vue";
export default Vue.extend({
  name: "MySchool",
  data() {
    return {
      name: "深圳大学",
      address:"深南大道3364号"
    };
  },

  props: {
    backSchoolName: {
      required: true,
      type: Function,
    },
  },
  methods: {
    sendShcoolName() {
      this.backSchoolName(this.name)
    },
    backAddress(){
      this.$emit('getAddress',this.address)
    }
  },
});
</script>
<style>
div {
    padding: 20px;
}
</style>